package csdn.xiancheng.li08;

public class Producer extends Thread{
    private Bum bum;
    private int produceCount; // 每次生产的数量
    
    public Producer(String name, Bum bum, int produceCount) {
        super(name);
        this.bum = bum;
        this.produceCount = produceCount;
    }

    @Override
    public void run() {
        while (true) {
            bum.producer(produceCount);
            //模拟生产包子时间
            try {
                Thread.sleep(2000);
           } catch (InterruptedException e) {
              e.printStackTrace();
           }
        }
    }
}
